import axios from "axios";

export const pendingMap = new Map();
export const ezvizInstance = axios.create({
    timeout: 20000,
    transformRequest: [
        function (data, _headers) {
            let str = "";
            for (let key in data) {
                str += key + "=" + data[key] + "&";
            }
            return str.slice(0, str.length - 1);
        },
    ],
});
ezvizInstance.interceptors.request.use(
    function (config) {
        return config;
    },
    function (error) {
        return Promise.resolve(error);
    }
);
ezvizInstance.interceptors.response.use(
    function (response) {
        return response;
    },
    function (error) {
        return Promise.resolve(error);
    }
);
